<template>
  <div>
    <p>
      <button @click="add">同步+1</button>
    </p>
        <span> {{ $store.state.num }} </span>
    <p>
      <button @click="reduce">同步-1</button>
    </p>
  </div>
</template>

<script>
export default {
  methods: {
    add() {
      this.$store.commit("add");
    },
    reduce() {
      this.$store.commit("reduce");
    },
  },
};
</script>

<style>
</style>